package com.yonyou.cyxdms.basedata.service.repository.brand;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.yonyou.cyx.framework.dao.base.SuperMapper;
import com.yonyou.cyxdms.basedata.client.domains.vo.BrandCacheVO;
import com.yonyou.cyxdms.basedata.service.dto.dmsFeign.SaveOrUpdateBasicAllDTO;
import com.yonyou.cyxdms.basedata.service.entity.brand.BrandPO;
import com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO;
import com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductBrandVO;
import com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductDcsBrandVO;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 品牌
 *
 * @author renwd
 * @since 2018/12/7
 */
public interface BrandMapper extends SuperMapper<BrandPO> {

    List<BrandCacheVO> queryBrandByCondition(@Param("params") Map<String, Object> queryParam);

    /**
     * 根据OWNER_CODE查询所有的品牌信息
     *
     * @param groupCode
     * @param appId
     * @return java.util.List<com.yonyou.cyxdms.basedata.client.domains.DTO.basedata.BrandCacheVO>
     * @author guorp
     * @since 2018/12/13
     */
    List<BrandCacheVO> getBrand(@Param("groupCode") String groupCode, @Param("appId") String appId);

    /**
     * 根据查询条件返回对应的品牌数据（pc）
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductBrandVO>
     * @author renwd
     * @since 2019/7/10
     */
    List<VehicleProductBrandVO> queryVehicleProductBrand(IPage page, @Param("params") Map<String, Object> queryParam);

    /**
     * 下拉框显示品牌
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/16
     */
    List<BrandDictVO> queryBrandDict(@Param("params") Map<String, Object> queryParam);

    /**
     * dcs下拉框显示品牌
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/19
     */
    List<BrandDictVO> queryDcsBrandDict(@Param("params") Map<String, Object> queryParam);

    /**
     * 获取导出用的sql语句
     *
     * @param queryParam
     * @return java.util.List<java.util.Map < java.lang.String, java.lang.Object>>
     * @author renwd
     * @since 2019/7/11
     */
    List<Map> selectBrandForExport(@Param("params") Map<String, Object> queryParam);

    /**
     * 提供给查询的下拉框的方法(包括无效的)
     *
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @author renwd
     * @since 2019/7/17
     */
    List<BrandDictVO> queryBrandsAll(@Param("params") Map<String, Object> queryParam);

    /**
     * dcs根据查询条件返回对应的品牌数据
     *
     * @param page
     * @param queryParam
     * @return java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.VehicleProductDcsBrandVO>
     * @author renwd
     * @since 2019/7/18
     */
    List<VehicleProductDcsBrandVO> queryDcsVehicleProductBrand(IPage page, @Param("params") Map<String, Object> queryParam);

    List<Map> queryBrand2(@Param("queryParam") Map<String, Object> queryParam);

    /**
     * @Description: 根据appId查询所有品牌
     * @Param: [appId]
     * @Return: java.util.List<com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO>
     * @Author: lijun
     * @Date: 16:02 2019/8/22
     **/
    List<BrandDictVO> allBrands(@Param("appId") String appId);

    /**
     * @Description: 根据brandCode获取brandName
     * @Param: [appId, brandCode]
     * @Return: com.yonyou.cyxdms.basedata.service.vo.brand.BrandDictVO
     * @Author: lijun
     * @Date: 16:02 2019/8/22
     **/
    BrandDictVO getByCode(@Param("appId") String appId,
                     @Param("brandCode") String brandCode);


    List<Long> getIdListByCondition(@Param("brandName")String brandName);

    Map<String, Object> queryBrandRelatedData(@Param("brandId") Long brandId,
                                              @Param("modelId") Long modelId,
                                              @Param("seriesId") Long seriesId,
                                              @Param("packageId") Long packageId,
											  @Param("optionId") Long optionId);


    Map<String, Object> queryBrandRelatedDataByCode(@Param("brandCode") String brandCode,
                                                    @Param("modelCode") String modelCode,
                                                    @Param("seriesCode") String seriesCode,
                                                    @Param("packageCode") String packageCode,
                                                    @Param("optionCode") String optionCode,
                                                    @Param("appId") String appId);

    /**
     * 品系型查询界面品牌下拉框
     *
     * @param queryParam
     * @author Tansj
     * @since 2019/11/15
     */
    List<BrandDictVO> queryBrandDictAll(@Param("params") Map<String, Object> queryParam);

    /**
     * 新增编辑界面本店面品牌下拉框
     *
     * @param queryParam
     * @author Tansj
     * @since 2019/11/15
     */
    List<BrandDictVO> queryBrandDictOwner(@Param("params") Map<String, Object> queryParam);

    /**
     * 新增编辑界面dcs品牌下拉框
     *
     * @param queryParam
     * @author Tansj
     * @since 2019/11/15
     */
    List<BrandDictVO> queryBrandDictDcs(@Param("params") Map<String, Object> queryParam);

    Map<String, Long> queryUpIntentCar(@Param("column") StringBuilder column,
                                       @Param("table") String table,
                                       @Param("condition") String condition,
                                       @Param("param") Long param);

    List<BrandDictVO> queryBrandDictAllNopar();
    //查询接口下发数据
    List<SaveOrUpdateBasicAllDTO> selectVechileAllInfo(@Param("params") Map<String, Object> queryParam);

}
